package br.factory.parametro;

import java.lang.reflect.Field;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;

import br.interfaces.Persistente;

public abstract class FactoryParametro {
	
	private static final char INTEGER = 'I';
	private static final char STRING = 'S';
	
	public static FactoryParametro getInstance(String tipoClasse) {
		char tipo = tipoClasse.charAt(0);
		switch (tipo) {
		case INTEGER:
			return new FactoryParametroInteger();
			
		case STRING:
			return new FactoryParametroString();
		}
		return null;
	}
	
	public abstract void setParametro(PreparedStatement preparedStatement, Object parametro, int sequencia) throws SQLException;
	public abstract void getParametro(String campo, Field field, Persistente objeto, ResultSet rs) throws Exception;

}
